<?php
/**
 * User: @lose
 * Date: 2019-09-25
 * Time: 17:19
 */

ini_set('display_errors', 1);
error_reporting(-1);

require_once '/data/wwwroot/g_vendor/autoload.php';


use Biz\model\activity\PageModule;

$data = PageModule::select('*');

foreach ($data as $info) {
    $item = [];
    if($info['ext']) {
        $ext = json_decode($info['ext'], true);
        if(isset($ext['link_url'])) {
            $ext['link_type'] = $ext['link_type'] . 'topic-add';
            $ext['link_params'] = substr($ext['link_params'], 10);
            $ext = json_encode($ext, JSON_UNESCAPED_UNICODE);
            PageModule::update(['ext' => $ext], ['id' => $info['id']]);
        }
    }
}